-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid recompiling executable if already compiled in previous tests #69
base: main
Are you sure you want to change the base?
Conversation
This is done by: - Storing compiled executable into a new "Build" folder - When running a new tests, comparing compiling options to those used in previous tests; it they match, the previous executable is retrieved from the Build folder. Note: this assumes that each executable name is unique ; i.e. that two sets of compiling options cannot produce the same executable name. In order to obtain the string that contains compiling options, part of the function `build_c` was extracted as a separate function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me - @zingale what do you think?
I'll test this now |
our suite fails if we try to use the new option: |
Re: hackathon - this feature is probably the most central one for why we forked. We would love to use mainline again if we can figure this out in a hackathon :) |
agreed, we need to find a way to do this without breaking other codes (e.g. Castro) |
Preliminary note
This PR re-opens PR #68, and incorporates several modifications:
avoid_recompiling
, deactivated by default) in order to enable or disable the feature implemented in this PR.The description below (which comes from PR#68) has been edited accordingly.
Overview
By default, when performing several tests with
regtest.py
, the executable is recompiled from scratch for every test. The compilation time can sometimes dominate the time taken by the tests.This PR proposes the avoid re-compiling the executable, if it was already compiled with the exact same options in a previous test. We are currently using this feature in order to same time in the Travis CI tests for WarpX.
In practice, this is done by:
PreviouslyCompiled
, where compiled executable are stored in unique sub-directory (unique to a given a set of compilation options).PreviouslyCompiled
folder.In order to obtain the string that contains compiling options, parts of the function
build_c
was extracted as a separate function. In addition, for convenience, the name of the executable is now stored as an attribute in theTest
class. (This allows the name of executable to be easily retrieved in the case where the executable is not recompiled from scratch.)